package com.ztt.utils;

import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;

import com.ztt.Config;

/**
 * 文件操作工作类
 * @author apple
 *
 */
public class FileUtils {
      
	public static void saveDataToLog(String savedStr){
		File log_file=new File(Config.ROOT_PATH+Config.IMAGE_DIRECTORY+Config.LOG_PATH);
		if(!log_file.exists()){
			log_file.mkdirs();
		}
		File file=null;
		if(log_file.exists()){
			file=new File(log_file, "log_"+DateUtil.getCurrentTime_BY_()+".txt");
			try {
				OutputStream oStream=new FileOutputStream(file);
				oStream.write(savedStr.getBytes());
				oStream.flush();
				oStream.close();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		
	}
}
